Next | Prev | Up | Top | Contents | Index

Entry Point Naming and lboot

The device driver makes known which entry points it supports by giving them public names in its object module. The lboot command links together the object modules of drivers and other kernel modules to make a bootable kernel. lboot recognizes the entry points by the form of their names.


Driver Name Prefix

A device driver must be described by a file in the /var/sysgen/master.d directory (see "Master Configuration Database"). One of the items in that configuration file specifies the driver prefix, a string of 1 to 14 characters that is unique to that driver. For example, the prefix of the SCSI driver is scsi_.

The prefix string is defined in the /var/sysgen/master.d file only. The string does not have to appear as a constant in the driver, and the name of the driver object file does not have to correspond to the prefix (although it typically has a related name).

The lboot command recognizes driver entry points by searching the driver object module for public names that begin with the prefix string. For example, the entry point for the open() operation must have a name that consists of the prefix string followed by the letters "open."

In this book, entry point names are written as follows: pfxopen, where pfx stands for the driver's prefix string.


Kernel Switch Tables

The IRIX kernel maintains tables that allow it to dispatch calls to device drivers quickly. These tables are built by lboot based on the device major numbers and the names of the driver entry points. The tables are named as follows:

bdevswTable of block device drivers
cdevswTable of character device drivers
fmodswTable of STREAMS drivers
vfsswTable of filesystem modules (not related to device drivers)

The tables for block and character drivers have one row for each major device number, and one column for each possible driver entry point. As lboot loads a driver, it fills in that driver's row of a switch table with the addresses of the driver's entry points. Where an entry point is not defined, lboot leaves the address of a null routine that returns the ENODEV error code.

The sizes of the switch tables are fixed at boot time in order to minimize kernel data space. The table sizes are tunable parameters that can be set with systune (see the systune(1) reference page).

When a driver is loaded dynamically (see "Configuring a Loadable Driver"), the associated row of the switch table is not filled at link time but rather is filled when the driver is loaded. When you add new, loadable drivers, you might need to specify a larger switch table. The IRIX Administration: System Configuration and Operation book documents these tunable parameters.


Next | Prev | Up | Top | Contents | Index